<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/common.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<link rel="Stylesheet" type="text/css"
	href="<c:url value="/static/css/jquery.ui.css"/>" />
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/common.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/Loading.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/showMsg.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/listBox/jquery.clever.listbox.js"/>"></script>
<script>
	var dataLeft;

	function initList(listDisplayEId) {
		$('#' + listDisplayEId).datagrid({
			nowrap : false,
			striped : true,
			collapsible : true,
			remoteSort : true,
			notSelectByRow : false,
			/* frozenColumns : [ [ {
			    field : 'ids',
			    checkbox : true
			} ] ], */
			onLoadError : function() {
				$.messager.alert('错误', '获取数据失败，请与管理员联系！', 'error');
			},
			onClickRow : function(rowIndex) {
				$(".myrad").prop("checked", false);
				$(".myrad").eq(rowIndex).prop("checked", true);
				$('#listDisplay').datagrid('beginEdit', rowIndex);
			}
		});
	};
	function excel() {
		$('#AddFoodForm')
				.form(
						'submit',
						{
							url : '<c:url value='/supplierDistribute/importSupDistributeSummarySheet.do'/>',
							onSubmit : function()//提交按钮相应函数
							{
								var Allwidth = '100%';
								var Allheight = '100%';
								Loading.Show({
									width : Allwidth,
									height : Allheight
								});
								setTimeout(function() {
									Loading.Hide();
								}, 3000)
								return $('#AddFoodForm').form('validate');
							},
							success : function(data) {
								data = eval("(" + data + ")");
								if (data.success) {
									$.messager.alert("提示", "生成成功！", 'info');
								} else {
									var message = "";
									if (data.msg == "locked") {
										message = "正在生成文件！";
									} else {
										message = data.msg;
									}
									$.messager.alert("提示", message, 'warning');
								}
							},
							error : function() {
								$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
								return;
							}
						});
	}

	function exceldown() {
		$('#AddFoodForm')
				.form(
						'submit',
						{
							url : '<c:url value='/supplierDistribute/importSupDistributeSummarySheetDown.do'/>', //查询提交路径
							onSubmit : function()//提交按钮相应函数
							{
								var Allwidth = '100%';
								var Allheight = '100%';
								Loading.Show({
									width : Allwidth,
									height : Allheight
								});
								setTimeout(function() {
									Loading.Hide();
								}, 3000)
								//校验
								if ($('#orderDate').datebox('getValue') == '') {
									$.messager.alert('提示', '订单日期没有填写！', 'info');
									closeShow();
								}
								return $('#AddFoodForm').form('validate');
							},
							success : function(data) {
								if (typeof (data) == 'string') {
									data = JSON.parse(data);
								}
								if (data.success) {
									$.messager.alert("提示", "生成成功！", 'info');
								} else {
									var message = "";
									if (data.msg == "locked") {
										message = "正在生成文件！";
									} else if (data.msg == "msg001") {
										message = "没有生成，请先生成。";
									} else if (data.msg == "msg0001") {
										message = "价格没有导入！请先导入报表价格！";
									}
									$.messager.alert("提示", message, 'warning');
								}
							},
							error : function() {
								$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
								return;
							}
						});

	}
	$(document).ready(function() {
		document.getElementById('zzy').style.display = 'none';
	    initHtmlProperties();
		initList('listDisplay');
	});
	function initHtmlProperties() {
		document.getElementById('zzy3').style.display = 'none';
        document.getElementById('zzy2').style.display = 'none';
        document.getElementById('companyIdAll').value = 0;
        document.getElementById('shopIdAll').value = 0;
        
		$('#orderDate').datebox({
			onSelect : function(date) {
				initList("listDisplay");
			}
		});

        $("#companyName").textbox({
            buttonText : '选择',
            iconAlign : 'left',
            editable : false,
            value : "无",
            multiline : true,
            height : '25px',
            onClickButton : function() {
                initDateLeft3();
                showMsgLeft3();
                ShowDiv3();
                var left = $('#left3').listbox();
                var items = left.getDatas();
                left.removeRange(items);

                $('#left3').listbox().reload({
                    data : dataLeft,
                    ajaxsettings : {
                        data : {
                            id : 'a'
                        }
                    }
                });
            }
        });
        
        $("#shopName").textbox({
            buttonText : '选择',
            iconAlign : 'left',
            editable : false,
            value : "无",
            multiline : true,
            height : '25px',
            onClickButton : function() {
                var companyIdAll =  document.getElementById('companyIdAll').value;

                if(companyIdAll =='' ||companyIdAll ==0 || companyIdAll== undefined){
                    companyIdAll = 0 ;
                }
                initDateLeft2(companyIdAll);
                showMsgLeft2();
                ShowDiv2();

                var left = $('#left2').listbox();
                var items = left.getDatas();
                left.removeRange(items);
                
                $('#left2').listbox().reload({
                    data : dataLeft,
                    ajaxsettings : {
                        data : {
                            id : 'a'
                        }
                    }
                });
            }
        });
	}

	function searchInfo() {
		//initDateLeft();
		showMsgLeft();
		ShowDiv();

		var left = $('#left').listbox();
		var items = left.getDatas();
		left.removeRange(items);

		var right = $('#right').listbox();
		var itemsr = right.getDatas();
		right.removeRange(itemsr);

		$('#left').listbox().reload({
			data : dataLeft,
			ajaxsettings : {
				data : {
					id : 'a'
				}
			}
		});

	}

	function ShowDiv() {
		var Allwidth = '100%';
		var Allheight = '100%';
		document.getElementById('zzy').style.display = '';
		Loading.Show({
			width : Allwidth,
			height : Allheight
		});
	}
	function ShowDiv3() {
        var Allwidth = '100%';
        var Allheight = '100%';
        document.getElementById('zzy3').style.display = '';
        Loading.Show({
            width : Allwidth,
            height : Allheight
        });
    }

	//初始化showMsg
	function showMsgLeft() {
		$('#left').listbox({
			data : dataLeft,
			height : 300,
			width : 200,
			dndscope : 'demo',
			dnd : false,
			multiselect : true,
			selectchange : function(data) {
				if (data && data.length > 0) {
					$('#btnRight').attr('disabled', false);
				} else {
					$('#btnRight').attr('disabled', true);
				}
			}
		});
		var data = [ {
			value : 10,
			text : 'think8848'
		}, {
			value : 20,
			text : 'aCloud'
		}, {
			value : 21,
			text : 'aaaaa'
		}, {
			value : 36,
			text : 'qqqqq'
		} ];
		$('#right').listbox({
			//data: data,
			height : 300,
			width : 200,
			dndscope : 'demo',
			dnd : true,
			multiselect : true
		});
		$('#btnRightAll').click(function() {
			var left = $('#left').listbox();
			var items = left.getDatas();
			left.clear();
			$('#right').listbox().addRange(items);
		});
		$('#btnLeftAll').click(function() {
			var right = $('#right').listbox();
			var items = right.getDatas();
			right.clear();
			$('#left').listbox().addRange(items);
		});
		$('#btnRight').click(function() {
			var left = $('#left').listbox();
			var items = left.getSelected();
			left.removeRange(items);
			$('#right').listbox().addRange(items);
		});
		$('#btnLeft').click(function() {
			var right = $('#right').listbox();
			var items = right.getSelected();
			right.removeRange(items);
			$('#left').listbox().addRange(items);
		});
		$('#btnRemove').click(function() {
			$('#right').listbox().removeRange([ {
				value : 2
			}, {
				value : 26
			} ]);
		});
		$('#btnSelect').click(function() {
			var selected = $('#right').listbox().getSelected();
			var msg = 'Selected count is: ' + selected.length;
			if (selected.length > 0) {
				msg += ', The first item text is: ' + selected[0].text;
			}
			msg += '.';
			alert(msg);
		});
		$('#btnGetItems').click(function() {
			var selected = $('#right').listbox('getDatas');
			alert('Items count is: ' + selected.length);
		});
		$('#btnSetSelection').click(function() {
			$('#left').listbox('setSelection', 1);
		});
		$('#select')
				.click(
						function() {
							Loading.Hide();
							document.getElementById('zzy').style.display = 'none';

							var right = $('#right').listbox();
							var items = right.getDatas();
							var userList = new Array();

							if (items.length > 0) {

								var jsonFater;
								for ( var e in items) {
									var jsonSun = "{materId:'" + items[e].value
											+ "'}";
									userList.push(jsonSun);
								}
								jsonFater = JSON.stringify(userList);
								document.getElementsByName("materdategridList")[0].value = jsonFater;
								$('#searchFormForShowCust')
										.form(
												'submit',
												{
													url : '<c:url value='/supplierDistribute/saveSupplierDistributeMaterForGather.do'/>', //查询提交路径
													onSubmit : function()//提交按钮相应函数
													{
														return $(
																'#searchFormForShowCust')
																.form(
																		'validate');
													},
													success : function() {
														$('#listDisplay')
																.datagrid(
																		'reload');
													},
													error : function() {
														$.messager.alert("错误",
																"系统错误，请联系管理员！",
																'error');
														return;
													}
												});
							}

						});
		$('#noselect').click(function() {
			Loading.Hide();
			document.getElementById('zzy').style.display = 'none';
		});
	}
	var xhr;
	function searchInfoForShowCust() {

		var materId = document.getElementById("materId").value;
		if (materId == '') {
			materId = 0;
		}

		var form = new FormData();
		form.append("materId", materId); // 可以增加表单数据
		form.append("materName", document.getElementById("materName").value); // 可以增加表单数据
		xhr = new XMLHttpRequest();
		xhr.onreadystatechange = state_Change;
		// xhr.setRequestHeader("Accept", "text/plain")
		xhr
				.open(
						"post",
						'<c:url value='/supplierDistribute/checkSupplierDistributeForGather.do'/>',
						true);
		xhr.send(form);
	}
	function state_Change() {
		if (xhr.readyState == 4) {// 4 = "loaded"

			if (xhr.status == 200) {// 200 = OK
				var data;
				data = xhr.responseText;
				if (typeof (data) == 'string' && data != '') {
					data = JSON.parse(data);
				}
				var a = data.stringJson;
				if (typeof (dataLeft) == 'string' && dataLeft != '') {
					a = JSON.parse(dataLeft);
				}
				$('#left').listbox().reload({
					data : a,
					ajaxsettings : {
						data : {
							id : 'a'
						}
					}
				});
			} else {
				alert("Problem retrieving XML data");
			}
		}
	}
	function deleteMater() {
		var row = $('#listDisplay').datagrid('getSelections');
		if (row.length != 1) {
			$.messager.alert('提示', '请选择一条记录操作！', 'info');
			return;
		} else {
			var str = "materId=" + row[0]['materId'];
			$.messager
					.confirm(
							'提示',
							'是否删除该条记录？',
							function(r) {
								if (r) {
									$
											.ajax({
												type : 'post',
												url : "<c:url value='/supplierDistribute/deleteSupplierDistributeMater.do'/>",
												data : str,
												dataType : "json",//设置查询参数及提交路径
												success : function(data) {
													if (typeof (data) == 'string') {
														data = JSON.parse(data);
													}
													if (data.success) {
														$.messager
																.alert(
																		"提示",
																		"删除成功！",
																		'info');
														$('#listDisplay')
																.datagrid(
																		'reload');
													} else {
														$.messager.alert("提示",
																data.msg,
																'warning');
													}
												},
												error : function() {
													$.messager.alert("错误",
															"系统错误，请联系管理员！",
															'error');
												}
											});
								}
								$('#listDisplay').datagrid('reload');
								$('#listDisplay').datagrid('clearSelections');
							});
		}
	}

	function updateMater() {
		var row = $('#listDisplay').datagrid('getSelections');
		if (row.length == 0) {
			$.messager.alert('提示', '请选择一条记录操作！', 'info');
			return;
		} else {

			var userList = new Array();
			var jsonFater;
			for (var i = 0; i < row.length; i++) {
				var rowIndex = $('#listDisplay').datagrid('getRowIndex',
						row[i]['materId']);
				$('#listDisplay').datagrid('endEdit', rowIndex);

				var jsonSun = "{materId:'" + row[i]['materId']
						+ "',orderMater:'" + row[i]['orderMater'] + "'}";
				userList.push(jsonSun);
			}
			beginEditList(row, '#listDisplay', 'materId');
			jsonFater = JSON.stringify(userList);
			alert()
			document.getElementsByName("materdategridList")[0].value = jsonFater;
			$('#searchFormForShowCust')
					.form(
							'submit',
							{
								url : '<c:url value='/supplierDistribute/updateSupplierDistributeMater.do'/>', //查询提交路径
								onSubmit : function()//提交按钮相应函数
								{
									return $('#searchFormForShowCust').form(
											'validate');
								},
								success : function(data) {
									if (typeof (data) == 'string') {
										data = JSON.parse(data);
									}
									if (data.success) {
										alert("更新成功");
										$('#listDisplay').datagrid('reload');
									}
								},
								error : function() {
									$.messager.alert("错误", "系统错误，请联系管理员！",
											'error');
									return;
								}
							});

		}
	}
	function beginEditList(rows, list, id) {
		for (var i = 0; i < rows.length; i++) {
			var rowIndex = $(list).datagrid('getRowIndex', rows[i][id]);
			$(list).datagrid('beginEdit', rowIndex);
		}
	}
	
	function initDateLeft2(companyIdAll) {
        $.ajax({
            async : false,
            url : "<c:url value='/shop/getShopIdBycompanyIdAllSupId.do'/>" +"?companyIdAll="+companyIdAll,
            type : "post",
            success : function(data) {
                if (typeof (data) == 'string' && data != '') {
                    data = JSON.parse(data);
                }
                dataLeft = data.stringJson;
                if (typeof (dataLeft) == 'string' && dataLeft != '') {
                    dataLeft = JSON.parse(dataLeft);
                }
                
            }
        });
    }
	function showMsgLeft2() {
        $('#left2').listbox({
            data : dataLeft,
            height : 300,
            width : 200,
            dndscope : 'demo',
            dnd : false,
            multiselect : true,
            selectchange : function(data) {
                if (data && data.length > 0) {
                    $('#btnRight2').attr('disabled', false);
                } else {
                    $('#btnRight2').attr('disabled', true);
                }
            }
        });
        $('#right2').listbox({
            //data: data,
            height : 300,
            width : 200,
            dndscope : 'demo',
            dnd : true,
            multiselect : true
        });
        $('#btnRightAll2').click(function() {
            var left = $('#left2').listbox();
            var items = left.getDatas();
            left.clear();
            $('#right2').listbox().addRange(items);
        });
        $('#btnLeftAll2').click(function() {
            var right = $('#right2').listbox();
            var items = right.getDatas();
            right.clear();
            $('#left2').listbox().addRange(items);
        });
        $('#btnRight2').click(function() {
            var left = $('#left2').listbox();
            var items = left.getSelected();
            left.removeRange(items);
            $('#right2').listbox().addRange(items);
        });
        $('#btnLeft2').click(function() {
            var right = $('#right2').listbox();
            var items = right.getSelected();
            right.removeRange(items);
            $('#left2').listbox().addRange(items);
        });
        $('#btnRemove2').click(function() {
            $('#right2').listbox().removeRange([ {
                value : 2
            }, {
                value : 26
            } ]);
        });
        $('#btnSelect2').click(function() {
            var selected = $('#right2').listbox().getSelected();
            var msg = 'Selected count is: ' + selected.length;
            if (selected.length > 0) {
                msg += ', The first item text is: ' + selected[0].text;
            }
            msg += '.';
            alert(msg);
        });
        $('#btnGetItems2').click(function() {
            var selected = $('#right2').listbox('getDatas');
            alert('Items count is: ' + selected.length);
        });
        $('#btnSetSelection2').click(function() {
            $('#left2').listbox('setSelection', 1);
        });
        $('#select2').click(function() {
            Loading.Hide();
            document.getElementById('zzy2').style.display = 'none';

            var right = $('#right2').listbox();
            var items = right.getDatas();
            var userNames = '';
            var userIds = '';

            if (items.length > 0) {
                for ( var e in items) {
                    userNames = userNames + items[e].text + ',';
                    userIds = userIds + items[e].value + ',';
                }
                userNames = userNames.substring(0, userNames.length - 1);
                userIds = userIds.substring(0, userIds.length - 1);
            }
            if (userNames != '' && userIds != '') {
                $('#shopName').textbox('setValue', userNames);
                document.getElementById('shopIdAll').value = userIds;
            } else {
                $('#shopName').textbox('setValue', '无');
                document.getElementById('shopIdAll').value = 0;
            }
        });
        $('#noselect2').click(function() {
            Loading.Hide();
            document.getElementById('zzy2').style.display = 'none';
        });
    }
	function ShowDiv2() {
        var Allwidth = '100%';
        var Allheight = '100%';
        document.getElementById('zzy2').style.display = '';
        Loading.Show({
            width : Allwidth,
            height : Allheight
        });
    }
	
	function initDateLeft3() {
        $.ajax({
            async : false,
            url : "<c:url value='/quotationCompany/getAllCompanyJsonForSup.do'/>" +"?diy=0",
            type : "post",
            success : function(data) {
                if (typeof (data) == 'string' && data != '') {
                    data = JSON.parse(data);
                }
                dataLeft = data.stringJson;
                if (typeof (dataLeft) == 'string' && dataLeft != '') {
                    dataLeft = JSON.parse(dataLeft);
                }
                
            }
        });
    }
	
	//初始化showMsg
    function showMsgLeft3() {
        $('#left3').listbox({
            data : dataLeft,
            height : 300,
            width : 200,
            dndscope : 'demo',
            dnd : false,
            multiselect : true,
            selectchange : function(data) {
                if (data && data.length > 0) {
                    $('#btnRight3').attr('disabled', false);
                } else {
                    $('#btnRight3').attr('disabled', true);
                }
            }
        });
        $('#right3').listbox({
            //data: data,
            height : 300,
            width : 200,
            dndscope : 'demo',
            dnd : true,
            multiselect : true
        });
        $('#btnRightAll3').click(function() {
            var left = $('#left3').listbox();
            var items = left.getDatas();
            left.clear();
            $('#right3').listbox().addRange(items);
        });
        $('#btnLeftAll3').click(function() {
            var right = $('#right3').listbox();
            var items = right.getDatas();
            right.clear();
            $('#left3').listbox().addRange(items);
        });
        $('#btnRight3').click(function() {
            var left = $('#left3').listbox();
            var items = left.getSelected();
            left.removeRange(items);
            $('#right3').listbox().addRange(items);
        });
        $('#btnLeft3').click(function() {
            var right = $('#right3').listbox();
            var items = right.getSelected();
            right.removeRange(items);
            $('#left3').listbox().addRange(items);
        });
        $('#btnRemove3').click(function() {
            $('#right3').listbox().removeRange([ {
                value : 2
            }, {
                value : 26
            } ]);
        });
        $('#btnSelect3').click(function() {
            var selected = $('#right3').listbox().getSelected();
            var msg = 'Selected count is: ' + selected.length;
            if (selected.length > 0) {
                msg += ', The first item text is: ' + selected[0].text;
            }
            msg += '.';
            alert(msg);
        });
        $('#btnGetItems3').click(function() {
            var selected = $('#right3').listbox('getDatas');
            alert('Items count is: ' + selected.length);
        });
        $('#btnSetSelection3').click(function() {
            $('#left3').listbox('setSelection', 1);
        });
        $('#select3').click(function() {
            Loading.Hide();
            document.getElementById('zzy3').style.display = 'none';

            var right = $('#right3').listbox();
            var items = right.getDatas();
            var userNames = '';
            var userIds = '';
            if (items.length ==0) {
                alert("请选取公司！");
                return false;
            }

            if (items.length > 0) {
                for ( var e in items) {
                    userNames = userNames + items[e].text + ',';
                    userIds = userIds + items[e].value + ',';
                }
                userNames = userNames.substring(0, userNames.length - 1);
                userIds = userIds.substring(0, userIds.length - 1);
            }
            if (userNames != '' && userIds != '') {
                $('#companyName').textbox('setValue', userNames);
                document.getElementById('companyIdAll').value = userIds;
            } else {
                $('#companyName').textbox('setValue', '无');
                document.getElementById('companyIdAll').value = 0;
            }
        });
        $('#noselect3').click(function() {
            Loading.Hide();
            document.getElementById('zzy3').style.display = 'none';
        });
    }
</script>
</head>
<body>
	<table width="80%">
		<tr>
			<td>
				<form id="AddFoodForm" name="AddFoodForm" method="post">
					<div
						style="height: auto; width: 1180px; background: #fafafa; padding: 5px;"
						class="easyui-panel" title="分货汇总表导出" iconCls="icon-add"
						collapsible="true" minimizable="false" maximizable="false"
						closable="false">
						<table cellpadding="5">
						    <tr>
						        <td>公司</td>
                                    <td><input style="word-wrap: break-word; word-break: break-all;" id="companyName" name="companyName"></input></td>
                                    <td>商店</td>
                                    <td><input style="word-wrap: break-word; word-break: break-all;" id="shopName" name="shopName"></input></td>
                                    
                                    <td><input class="easyui-validatebox" editable="false" hidden='true' id="companyIdAll" name="companyIdAll"></input></td>
                                    <td><input class="easyui-validatebox" editable="false" hidden='true' id="shopIdAll" name="shopIdAll" ></input></td>
                                        
						    </tr>
							<tr>
								<td>日期</td>
								<td><input class="easyui-datebox" name="orderDate"
									id="orderDate" editable="false" data-options="required:true" />
								</td>
								<td><a href="#" class="easyui-linkbutton"
									onclick="excel();">生成</a></td>
								<td><a href="#" class="easyui-linkbutton"
									onclick="exceldown();">下载</a></td>

							</tr>
							<input class="easyui-validatebox" type="hidden" name="supId"
								value="0" />
						</table>
					</div>
				</form>
			</td>
		</tr>

	</table>

	<table width="80%">
		<tr>
			<td width="99%" valign="top">
				<table width="100%">
					<tr style="height: 12px;"></tr>
					<tr>
						<td>
							<table id="listDisplay" title="材料列表" iconCls="icon-list"
								singleSelect="false" idField="materId"
								url="<c:url value="/supplierDistribute/findMaterForSupplierDistribute.do"/>"
								loadMsg="请稍候......" pagination="false" pageSize="20"
								pageList="[10,20,30,40,50,100]" sortName="materId"
								rownumbers="true" toolbar="#tb" sortOrder="asc">
								<thead>
									<tr>
										<th field="materRole" width="25" align="center"
											checkbox="true"></th>
										<th field="materId" width="50" sortable="true">材料ID</th>
										<th field="unit" width="50" sortable="true">单位</th>
										<th field="materName" width="140" sortable="true">材料名</th>
										<th field="materType" width="60" formatter="formatFoodType1"
											sortable="true">种类</th>
										<th field="brands" width="50" sortable="true">品牌</th>
										<th field="specifications" width="60" sortable="true">规格</th>
										<th field="orderMater" width="60" sortable="true"
											editor="text">顺序</th>
									</tr>
								</thead>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<div id="tb" style="padding: 5px; height: auto">
		<div>
			<table>
				<tr>
					<td><a href="#" onclick="searchInfo()"
						class="easyui-linkbutton" iconCls="icon-add" plain="true">添加新的材料位置</a></td>
					<td><a href="#" onclick="deleteMater()"
						class="easyui-linkbutton" iconCls="icon-add" plain="true">删除材料位置</a></td>
					<td><a href="#" onclick="updateMater()"
						class="easyui-linkbutton" iconCls="icon-add" plain="true">更新所有材料位置</a></td>
			</table>
		</div>
		<div style="margin-bottom: 5px"></div>
	</div>
	<div style='position: absolute; left: 40px; top: 40px; z-index: 101; background-color: #FFFFFF; border-radius: 10px; width: 600px;'
		id="zzy">
		<table align="center">
			<tr>
				<td colspan="3">
					<form id="searchFormForShowCust" name="searchFormForShowCust"
						method="post" accept-charset="UTF-8">
						<div
							style="height: auto; width: 400; background: #fafafa; padding: 5px;"
							class="easyui-panel" title="查询" iconCls="icon-search"
							collapsible="true" minimizable="false" maximizable="false"
							closable="false">
							<table>
								<tr>
									<td>材料id:</td>
									<td><input class="easyui-validatebox" name="materId"
										id="materId" /></td>
									<td>材料名称:</td>
									<td><input class="easyui-validatebox" name="materName"
										id="materName" /></td>
									<td><a href="#" class="easyui-linkbutton"
										data-options="iconCls:'icon-search'" style="width: 60px"
										onclick="searchInfoForShowCust()">查询</a></td>
									<td><input type="hidden" name="materdategridList"
										id="materdategridList" /></td>

								</tr>
							</table>
						</div>
					</form>
				</td>
			</tr>
			<tr>
				<td>
					<ul id="left">
					</ul>
				</td>
				<td><input type="button" value="&gt;&gt;" id="btnRightAll"
					style="width: 50px;" /><br /> <input type="button" value="&gt;"
					id="btnRight" style="width: 50px;" /><br /> <input type="button"
					value="&lt;" id="btnLeft" style="width: 50px;" /><br /> <input
					type="button" value="&lt;&lt;" id="btnLeftAll" style="width: 50px;" />
				</td>
				<td>
					<ul id="right">
					</ul>
				</td>
			</tr>
		</table>
		<table align="center">
			<tr>
				<!--  
                <td><input type="button" value="Add Item" id="btnAdd" /></td>
                <td><input type="button" value="Remove Item" id="btnRemove" /></td>
                <td><input type="button" value="Get Select" id="btnSelect" /></td>
                <td><input type="button" value="Get Items" id="btnGetItems" /></td>
                <td><input type="button" value="SetSelection (value equal to '1')" id="btnSetSelection" /></td>
                <td><input type="button" value="Reload" id="btnReload" /></td>
                -->
				<td><input type="button" value="取消" id="noselect" /></td>
				<td width="200px"></td>
				<td><input type="button" value="选择" id="select" /></td>

			</tr>
		</table>
	</div>
	<div
        style='position: absolute; left: 40px; top: 40px; z-index: 101; background-color: #FFFFFF; border-radius: 10px; width: 550px;'
        id="zzy3">
        <table align="center">
            
            <tr>
                <td>
                    <ul id="left3">
                    </ul>
                </td>
                <td><input type="button" value="&gt;&gt;" id="btnRightAll3"
                    style="width: 50px;" /><br /> <input type="button" value="&gt;"
                    id="btnRight3" style="width: 50px;" /><br /> <input type="button"
                    value="&lt;" id="btnLeft3" style="width: 50px;" /><br /> <input
                    type="button" value="&lt;&lt;" id="btnLeftAll3" style="width: 50px;" /></td>
                <td>
                    <ul id="right3">
                    </ul>
                </td>
            </tr>
        </table>
        <table align="center">
            <tr>
                <!--  
                <td><input type="button" value="Add Item" id="btnAdd" /></td>
                <td><input type="button" value="Remove Item" id="btnRemove" /></td>
                <td><input type="button" value="Get Select" id="btnSelect" /></td>
                <td><input type="button" value="Get Items" id="btnGetItems" /></td>
                <td><input type="button" value="SetSelection (value equal to '1')" id="btnSetSelection" /></td>
                <td><input type="button" value="Reload" id="btnReload" /></td>
                -->
                <td><input type="button" value="取消" id="noselect3" /></td>
                <td width="200px"></td>
                <td><input type="button" value="选择" id="select3" /></td>

            </tr>
        </table>
    </div>
    <div
        style='position: absolute; left: 40px; top: 40px; z-index: 101; background-color: #FFFFFF; border-radius: 10px; width: 550px;'
        id="zzy2">
        <table align="center">
           
            <tr>
                <td>
                    <ul id="left2">
                    </ul>
                </td>
                <td><input type="button" value="&gt;&gt;" id="btnRightAll2"  style="width: 50px;" /><br />
                    <input type="button" value="&gt;"     id="btnRight2" style="width: 50px;" /><br /> 
                    <input type="button" value="&lt;" id="btnLeft2" style="width: 50px;" /><br /> 
                    <input type="button" value="&lt;&lt;" id="btnLeftAll2" style="width: 50px;" /></td>
                <td>
                    <ul id="right2">
                    </ul>
                </td>
            </tr>
        </table>
        <table align="center">
            <tr>
                <!--  
                <td><input type="button" value="Add Item" id="btnAdd" /></td>
                <td><input type="button" value="Remove Item" id="btnRemove" /></td>
                <td><input type="button" value="Get Select" id="btnSelect" /></td>
                <td><input type="button" value="Get Items" id="btnGetItems" /></td>
                <td><input type="button" value="SetSelection (value equal to '1')" id="btnSetSelection" /></td>
                <td><input type="button" value="Reload" id="btnReload" /></td>
                -->
                <td><input type="button" value="取消" id="noselect2" /></td>
                <td width="200px"></td>
                <td><input type="button" value="选择" id="select2" /></td>

            </tr>
        </table>
    </div>
</body>
</html>